<%@ page language="java" import="java.sql.*" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="control.*"%>
<%
request.setCharacterEncoding("utf-8");
String name = request.getParameter("name");
String email = request.getParameter("email");

System.out.println(name);
System.out.println(email);  


Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;

try{
	ServerIp ip = new ServerIp();
	Class.forName(ip.getDriver());
	conn = DriverManager.getConnection(ip.getUrl(),ip.getId(),ip.getPw());
	String sql="select mb_id from member_info where mb_name=? and mb_email=?";
	pstmt=conn.prepareStatement(sql);
	pstmt.setString(1, name);
	pstmt.setString(2, email);
	rs = pstmt.executeQuery();
}catch(Exception e){
	e.printStackTrace();
}

if(rs.next()){
	out.println("아이디는 입니다.");
	String mbId = rs.getString("mb_id");
	out.println( " 요청하신 아이디는 " + mbId +" 입니다.");
}else{
	out.println("입력하신 정보가 등록되어 있지않거나 이름과 이메일이 잘못기재되었습니다.");
}


conn.close();
pstmt.close();
rs.close();
conn.close();pstmt.close();rs.close();

%>
<br/><br/><center><a href="" onClick="javascript:self.close()">확인</a></center>